// d:\lab\Electron\electron-vite_rtsp-to-hls\electron-app\test-create-file.js
const fs = require('fs')
const path = require('path')

// 获取当前时间
const currentTime = new Date().toString()
const filePath = path.join(process.cwd(), 'test.txt')

// 尝试创建文件并写入当前时间
try {
  fs.writeFileSync(filePath, currentTime)
  console.log(`文件已成功创建: ${filePath}`)
  console.log(`文件内容: ${currentTime}`)
  console.log(`当前工作目录: ${process.cwd()}`)
} catch (error) {
  console.error(`创建文件失败: ${error.message}`)
  console.error(`错误详情:`, error)
}
